package com.foreknow.demo13;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Test{

    public static void main(String[] args) {
        IOStudent ioStudent = new IOStudent();
        Scanner input = new Scanner(System.in);
        List<Student> students = new ArrayList<>();
        for (int i = 0;i<3;i++) {
            Student student = new Student();
            System.out.println("请输入学生学号");
            int id = input.nextInt();
            System.out.println("请输入学生姓名");
            String name = input.next();
            System.out.println("请输入学生年龄");
            int age = input.nextInt();
            System.out.println("请输入学生学校");
            String school = input.next();
            student.setId(id);
            student.setName(name);
            student.setAge(age);
            student.setSchool(school);
            students.add(student);
        }
        ioStudent.save(students);
        ioStudent.read();
    }
}
